<html>
<head><meta charset="utf-8"><title>Questions about lint level checking. · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Questions.20about.20lint.20level.20checking.2E.html">Questions about lint level checking.</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="200744387"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Questions%20about%20lint%20level%20checking./near/200744387" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Charles Lew <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Questions.20about.20lint.20level.20checking.2E.html#200744387">(Jun 13 2020 at 02:17)</a>:</h4>
<p>So i'm adding a check within src/librustc_lint/levels.rs <a href="https://github.com/crlf0710/rust/commit/9ea10e749767f4e9c97dbef2ad9bceb24de7be8d#diff-c2c9f6bb6073e5b9a7ff19ad6596c5a2R341-R364">https://github.com/crlf0710/rust/commit/9ea10e749767f4e9c97dbef2ad9bceb24de7be8d#diff-c2c9f6bb6073e5b9a7ff19ad6596c5a2R341-R364</a></p>



<a name="200744430"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Questions%20about%20lint%20level%20checking./near/200744430" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Charles Lew <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Questions.20about.20lint.20level.20checking.2E.html#200744430">(Jun 13 2020 at 02:18)</a>:</h4>
<p>It mostly works fine, the only problem is that, when there's an error, it got triggered three times.</p>



<a name="200744513"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Questions%20about%20lint%20level%20checking./near/200744513" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Charles Lew <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Questions.20about.20lint.20level.20checking.2E.html#200744513">(Jun 13 2020 at 02:20)</a>:</h4>
<p>I investigated into how that happens, and it seems that the first comes from</p>
<div class="codehilite"><pre><span></span><code>  10: rustc_lint::levels::LintLevelsBuilder::push
  11: &lt;rustc_lint::early::EarlyContextAndPass&lt;T&gt; as rustc_ast::visit::Visitor&gt;::visit_item
  12: rustc_ast::visit::walk_crate
  13: rustc_lint::early::check_ast_crate
  14: rustc_session::utils::&lt;impl rustc_session::session::Session&gt;::time
  15: rustc_interface::passes::configure_and_expand_inner
</code></pre></div>


<p>The second:</p>
<div class="codehilite"><pre><span></span><code>  10: rustc_lint::levels::LintLevelsBuilder::push
  11: &lt;rustc_lint::early::EarlyContextAndPass&lt;T&gt; as rustc_ast::visit::Visitor&gt;::visit_item
  12: rustc_ast::visit::walk_crate
  13: rustc_lint::early::check_ast_crate
  14: rustc_session::utils::&lt;impl rustc_session::session::Session&gt;::time
  15: rustc_interface::passes::lower_to_hir
</code></pre></div>



<a name="200744521"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Questions%20about%20lint%20level%20checking./near/200744521" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Charles Lew <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Questions.20about.20lint.20level.20checking.2E.html#200744521">(Jun 13 2020 at 02:20)</a>:</h4>
<p>The third:</p>
<div class="codehilite"><pre><span></span><code>  10: rustc_lint::levels::LintLevelsBuilder::push
  11: &lt;rustc_lint::early::EarlyContextAndPass&lt;T&gt; as rustc_ast::visit::Visitor&gt;::visit_item
  12: rustc_ast::visit::walk_crate
  13: rustc_lint::early::check_ast_crate
  14: rustc_lint::early::check_ast_crate
  15: rustc_session::utils::&lt;impl rustc_session::session::Session&gt;::time
  16: rustc_interface::passes::lower_to_hir
</code></pre></div>



<a name="200744536"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Questions%20about%20lint%20level%20checking./near/200744536" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Charles Lew <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Questions.20about.20lint.20level.20checking.2E.html#200744536">(Jun 13 2020 at 02:20)</a>:</h4>
<p>In general this makes sense, since the code really runs multiple times.</p>



<a name="200744552"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Questions%20about%20lint%20level%20checking./near/200744552" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Charles Lew <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Questions.20about.20lint.20level.20checking.2E.html#200744552">(Jun 13 2020 at 02:21)</a>:</h4>
<p>However, there's a neighboring check just next to it:<br>
<a href="https://github.com/crlf0710/rust/commit/9ea10e749767f4e9c97dbef2ad9bceb24de7be8d#diff-c2c9f6bb6073e5b9a7ff19ad6596c5a2R369-R404">https://github.com/crlf0710/rust/commit/9ea10e749767f4e9c97dbef2ad9bceb24de7be8d#diff-c2c9f6bb6073e5b9a7ff19ad6596c5a2R369-R404</a></p>



<a name="200744604"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Questions%20about%20lint%20level%20checking./near/200744604" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Charles Lew <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Questions.20about.20lint.20level.20checking.2E.html#200744604">(Jun 13 2020 at 02:22)</a>:</h4>
<p><a href="https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=26657889517b3ec0db16c9fa50def768">https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=26657889517b3ec0db16c9fa50def768</a><br>
This error doesn't trigger multiple times... I'm puzzled by the difference.</p>



<a name="200745140"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Questions%20about%20lint%20level%20checking./near/200745140" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Charles Lew <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Questions.20about.20lint.20level.20checking.2E.html#200745140">(Jun 13 2020 at 02:37)</a>:</h4>
<p>Oh never mind, it seems that error is also triggered three times. It's just that there're no internal tests covering E0453.</p>



<a name="200745178"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Questions%20about%20lint%20level%20checking./near/200745178" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Charles Lew <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Questions.20about.20lint.20level.20checking.2E.html#200745178">(Jun 13 2020 at 02:38)</a>:</h4>
<p>I wonder if this is worth fixing?</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>